package com.tyl.dao.user;

import com.tyl.pojo.User;

import java.io.StringReader;
import java.sql.Connection;
import java.sql.SQLException;
import java.util.List;

public interface UserDao {
    // 实现登录查询判断
    public User getLoginUser(Connection connection,String userCode,String userPassword) throws SQLException;
    // 实现修改密码
    public  int updatePwd(Connection connection,int id,String password) throws SQLException;

    //根据用户名或者用户角色查询用户总数
    public int getUserCount(Connection connection,String userName,int userRole) throws SQLException;

    //获取用户列表
    List<User> getUserList(Connection connection,String userName,int userRole,int currentPageNo,int pageSize)throws SQLException;

    //添加用户
    public int addUser(Connection connection,User user) throws SQLException;

    //根据用户编码查询用户
    public User getUserCode(Connection connection, String userCode) throws SQLException;

    //根据用户ID查询用户
    public User getUserId(Connection connection, String userId) throws SQLException;

    //删除用户
    public int deleteByUserId(Connection connection, Integer userId) throws SQLException;

    // 修改用户信息
    public  int updateUser(Connection connection,User user);
}
